<template>
    <div>
        <h1>显示</h1>
       <table>
        <thead>
            <tr>
                <td>姓名</td>
                <td>手机号</td>
                <td>账号</td>
                <td>密码</td>
                <td>所属角色</td>
                <td>创建人</td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="a in data">
                <td>{{ a.name }}</td>
                <td>{{ a.phone.substring(0,3)+"****"+ a.phone.substring(7,11) }}</td>
                <td>{{ a.number }}</td>
                <td>***</td>
                <td>{{ a.nName }}</td>
                <td>{{ a.peoo }}</td>
            </tr>
        </tbody>
       </table>
    </div>
</template>

<script setup lang="ts">
import { ref,onMounted } from 'vue';
import axios from 'axios';

onMounted(()=>{
    show();
})

const show=()=>{
    axios.get("https://localhost:7249/api/User/Show",{params:data.value}).then(res=>{
        data.value=res.data;
    })
}


const data=ref([{
  "id": 0,
  "name": "",
  "phone": "",
  "number": "",
  "pwd": "",
  "nName": "",
  "peoo": ""
}])
</script>

<style scoped>

</style>